/**
 * DLA/Oscilloscope Project Software
 * 
 * By Kevin Cuzner <kevincuzner@yahoo.com>
 * 
 * This file is part of the DLA/Oscilloscope Project Software.
 *
 * The DLA/Oscilloscope Project Software is free software: you can 
 * redistribute it and/or modify it under the terms of the GNU Lesser
 * General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * The DLA/Oscilloscope Project Software is distributed in the hope
 * that it will be useful, but WITHOUT ANY WARRANTY; without even the
 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with The DLA/Oscilloscope Project Software.
 * If not, see <http://www.gnu.org/licenses/>.
 */

using System;

namespace DLAOscilloscopegtk
{
	/**
	 * Interface for a source which can return raw sample data. This is used as
	 * an abstraction layer between the sample reading and the actual driver for
	 * the device being read from
	 */
	public interface ISampleSource
	{
		/**
		 * Returns whether or not there are samples available for pickup
		 */
		bool SampleWindowAvailable();
		/**
		 * Gets the sample type
		 */
		SampleType SampleType {
			get;
		}
		/**
		 * Gets the current sample speed in Hz
		 */
		long SampleSpeed {
			get;
		}
		/**
		 * Gets the sample window at the top of the queue. If there are no windows available, this
		 * will return null
		 */
		SampleWindow ReadSampleWindow();
		/**
		 * Requests a new sampling speed from the source. It will return the new
		 * actual set sample speed
		 * @param speed The requested speed in Hz
		 */
		long RequestSampleSpeed(long speed);
		/**
		 * Requests a change of sample type. Returns if successful
		 * @param request - The requested sample type
		 * @returns If the change succeeded. If it did not, the source does not support the sample type requested
		 */
		bool RequestSampleType(SampleType type);
		/**
		 * Gets the channels (in the form of channel mappings) that this sample source is returning
		 */
		ChannelMapping.ChannelMappingContainer Channels {
			get;
		}
		/**
		 * Gets the identifier string for the sample source
		 */
		string Name {
			get;
		}
	}
	
	public enum SampleType { ANALOG=0, DLA=1 };
}

